<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>已发布的文章-[[${session.admin.name}]]的博客</title>
    <meta name="description" content="Free Bootstrap 4 Admin Theme | Pike Admin">
    <!-- Favicon -->
    <link rel="shortcut icon" href="background/images/favicon.ico">
    <!-- Switchery css -->
    <link href="background/plugins/switchery/switchery.min.css" rel="stylesheet" />
    <!-- Bootstrap CSS -->
    <link href="background/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome CSS -->
    <link href="background/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Custom CSS -->
    <link href="background/css/style.css" rel="stylesheet" type="text/css" />
    <!-- BEGIN CSS for this page -->
    <link rel="stylesheet" type="text/css" href="common/css/dataTables.bootstrap4.min.css"/>
    <style>
        td.details-control {
            background: url('background/plugins/datatables/img/details_open.png') no-repeat center center;
            cursor: pointer;
        }
        tr.shown td.details-control {
            background: url('background/plugins/datatables/img/details_close.png') no-repeat center center;
        }
    </style>
    <!-- END CSS for this page -->
</head>
<body class="adminbody">
<div id="main">
    <!-- top bar navigation -->
    <div th:replace="common/bar::#top"></div>
    <!-- End Navigation -->


    <!-- Left Sidebar -->
    <div th:replace="common/bar::#sidebar(currUri='articles',unRead=${unRead})"></div>
    <!-- End Sidebar -->

    <div class="content-page">

        <!-- Start content -->
        <div class="content">

            <div class="container-fluid">

                <div class="row">
                    <div class="col-xl-12">
                        <div class="breadcrumb-holder">
                            <h1 class="main-title float-left">
                                已发布 &ensp;
                            </h1>
                            <div class="float-left">
                                <a href="edit" class="btn btn-sm btn-outline-success"> 写文章</a>
                            </div>

                            <ol class="breadcrumb float-right">
                                <li class="breadcrumb-item active">已发布([[${statusCount.publish}]])</li>
                                <li class="breadcrumb-item"><a href="articles?type=draft">草稿箱([[${statusCount.draft}]])</a></li>
                                <li class="breadcrumb-item"><a href="articles?type=trash">回收站([[${statusCount.trash}]])</a></li>
                            </ol>
                            <div class="clearfix"></div>
                        </div>
                    </div>
                </div>
                <!-- end row -->

                <div class="row">

                    <div class="col-xs-12 col-sm-12 col-md-12">
                        <div class="card mb-3">
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table id="example1" class="table table-bordered table-hover display" style="text-align: center">
                                        <thead>
                                        <tr>
                                            <th style="width: 20%">标题</th>
                                            <th style="width: 15%">文集</th>
                                            <th style="width: 15%">标签</th>
                                            <th>浏览次数</th>
                                            <th>最后修改</th>
                                            <th>评论</th>
                                            <th style="width: 10%">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody style="font-size: 13px">
                                            <tr th:each="article : ${articles}">
                                                <td style="font-size: 15px;font-weight: 700">
                                                    <a th:href="@{edit(id=${article.id})}" th:title="${'编辑 - 《' + article.title + '》'}">[[${article.title}]]</a>
                                                </td>
                                                <td th:if="${article.kinds != null}">
                                                    《[[${article.kinds.name}]]》
                                                </td>
                                                <td th:if="${article.kinds == null}">
                                                    —
                                                </td>
                                                <td th:if="${article.tags.size() == 0}">
                                                    —
                                                </td>
                                                <td th:if="${article.tags.size() != 0}">
                                                    <span style="margin: 1px" th:each="tag:${article.tags}" th:text="${tag.name}" class="label label-info"></span>
                                                </td>
                                                <td>
                                                    [[${article.readCount}]]
                                                </td>
                                                <td>
                                                    <span>
                                                        [[${#dates.format(article.recentEdit,'yyyy-MM-dd HH:mm:ss')}]]
                                                    </span>
                                                </td>
                                                <td th:if="${article.comment == null}">
                                                    0
                                                </td>
                                                <td th:if="${article.comment != null}" th:text="${article.comment}">

                                                </td>
                                                <td>
                                                    <a th:href="@{article(id=${article.id})}" class="btn btn-sm btn-success" title="查看"><i class="fa fa-eye"></i></a>
                                                    <button th:onclick="deleteLight([[${article.id}]],'publish')" th:if="${article.status != 2}" class="btn btn-sm btn-danger" title="移入回收站"><i class="fa fa-trash"></i></button>
                                                </td>
                                            </tr>
                                        </tbody>
                                        <thead>
                                        <tr>
                                            <th style="width: 20%">标题</th>
                                            <th>文集</th>
                                            <th>标签</th>
                                            <th>浏览次数</th>
                                            <th>日期</th>
                                            <th>评论</th>
                                            <th style="width: 10%">操作</th>
                                        </tr>
                                        </thead>
                                    </table>
                                </div>

                            </div>
                        </div><!-- end card-->
                    </div>
                </div>

            </div>
            <!-- END container-fluid -->

        </div>
        <!-- END content -->

    </div>
    <!-- END content-page -->

    <div th:replace="common/bar::#footer"></div>

</div>
<!-- END main -->

<script src="background/js/modernizr.min.js"></script>
<script src="background/js/jquery.min.js"></script>
<script src="background/js/moment.min.js"></script>

<script src="background/js/popper.min.js"></script>
<script src="background/js/bootstrap.min.js"></script>

<script src="background/js/detect.js"></script>
<script src="background/js/fastclick.js"></script>
<script src="background/js/jquery.blockUI.js"></script>
<script src="background/js/jquery.nicescroll.js"></script>
<script src="background/js/jquery.scrollTo.min.js"></script>
<script src="background/plugins/switchery/switchery.min.js"></script>

<!-- App js -->
<script src="background/js/pikeadmin.js"></script>

<!-- BEGIN Java Script for this page -->
<script src="common/js/jquery.dataTables.min.js"></script>
<script src="common/js/dataTables.bootstrap4.min.js"></script>
<script src="common/js/sweetalert.min.js"></script>
<script src="common/js/common.js"></script>
<script src="common/js/article.js"></script>

<script>
    // START CODE FOR BASIC DATA TABLE
    $(document).ready(function() {
        $('#example1').DataTable({
            language: {
                "sProcessing": "处理中...",
                "sLengthMenu": "显示 _MENU_ 项结果",
                "sZeroRecords": "没有匹配结果",
                "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
                "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                "sInfoPostFix": "",
                "sSearch": "搜索:",
                "sUrl": "",
                "sEmptyTable": "表中数据为空",
                "sLoadingRecords": "载入中...",
                "sInfoThousands": ",",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上页",
                    "sNext": "下页",
                    "sLast": "末页"
                },
                "oAria": {
                    "sSortAscending": ": 以升序排列此列",
                    "sSortDescending": ": 以降序排列此列"
                }
            },
            "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 2,6,5 ] }],
            "order": [4, "desc"]

        });
    });
    // END CODE FOR BASIC DATA TABLE


    // START CODE FOR Child rows (show extra / detailed information) DATA TABLE


</script>
<!-- END Java Script for this page -->

</body>
</html>